project(analysis)
message("-- libkperf library path: ${LIB_KPERF_LIBPATH}")
message("-- libkperf include path: ${LIB_KPERF_INCPATH}")
set(analysis_src
    analysis/analysis.cpp
    analysis/common.cpp
    analysis/env.cpp
    hugepage/hugepage_analysis.cpp
    hugepage/hugepage_analysis_impl.cpp
    common/analysis_utils.cpp
)

set(oeaware_src analysis_oeaware.cpp)

add_library(hugepage OBJECT ${analysis_src})
target_include_directories(hugepage PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/analysis
    ${CMAKE_CURRENT_SOURCE_DIR}/common
    ${LIB_KPERF_INCPATH}
    ../../../common
)

target_link_libraries(hugepage numa boundscheck)

add_library(analysis_oeaware SHARED ${oeaware_src})

if (WITH_ASAN)
    enable_asan(analysis_oeaware)
endif()

target_link_libraries(analysis_oeaware hugepage)
set_target_properties(analysis_oeaware PROPERTIES
                      LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_OUTPUT_LIBRARY_DIRECTORY})